#pragma once

#include <math.h>
#include <stdlib.h>

#include "Vector2D.h"
#include "Vector3D.h"

#define MATH_PI        3.141592654f
#define FLOAT_MAX      3.402823466e+38F
#define FLOAT_MIN      1.175494351e-38F
#define RADIAN(degree) (degree*(MATH_PI/180.0f))
#define DEGREE(radian) (radian*(180.0f/MATH_PI))
#define MAX_VAL(a,b)   ((a>b)?a:b)
#define MIN_VAL(a,b)   ((a<b)?a:b)

int randI();
int randI(int min, int max);

float randF();
float randF(float min, float max);

float polarAngle(V2DF c);
float polarAngleXY(V3DF c);
float polarAngleXZ(V3DF c);

V2DF nrCrPoint(V2DF c, float r, V2DF p);
bool pointInAABB(V2DF pnt, V2DF min, V2DF max);
bool C2COverlap(V2DF cA, float rA, V2DF cB, float rB);